package pub.tbc.hh.mall.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

/**
 * @auth tbc on 2018/5/20.
 */
@Mapper
public interface WaresTypeMapper {

    @Select("select id, type_name typeName from t_wares_type where is_del = 0")
    Map<String, Object> queryWaresTypes();

    @Insert("insert into t_wares_type(typeName)value(#{typeName})")
    int addOne(String typeName);

    @Update("update t_wares_type set is_del = 1 where id = #{id}")
    int delete(long id);

    @Update("update t_wares_type set type_name= #{typeName} where id = #{id}")
    int updateName(long id, String typeName);

}
